﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Gnosis.Babel;

namespace Gnosis.SQLite.Statements
{
    public class Statement
        : Expression, IStatement
    {
        public Statement()
            : this(new List<IExpression>())
        {
        }

        public Statement(IExpression expression)
            : this(new List<IExpression> { expression })
        {
        }

        public Statement(IList<IExpression> children)
            : base(string.Empty, " ", string.Empty, children)
        {
        }

        protected Statement(string postfix, IStatement statement)
            : base(string.Empty, string.Empty, postfix, statement)
        {
        }

        private readonly IDictionary<string, object> _parameters = new Dictionary<string, object>();

        #region IStatement Members

        public IEnumerable<KeyValuePair<string, object>> Parameters
        {
            get { return _parameters; }
        }

        public void AddParameter(string name, object value)
        {
            _parameters.Add(name, value);
        }

        #endregion
    }
}
